package com.mycompany;

import com.mycompany.bean.Product;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        // 加载Spring配置文件，初始化IOC容器
        ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");

        // 从容器中获取Product Bean
        Product product = (Product) context.getBean("product");
        System.out.println("从Spring容器获取的Product: " + product);

    }
}
